Boost
boost
arrow_drop_down
Boost.Multiprecision

This Release

John Maddock
John Maddock
Author
Christopher Kormanyos
Author
Chris Kormanyos
Chris Kormanyos
Maintainer
Adam Wulkiewicz
Adam Wulkiewicz
Contributor - New
Matt Borland
Matt Borland
Contributor

Boost Multiprecision Library

ANNOUNCEMENT: Support for C++03 is now removed from this library. Any attempt to build with a non C++11 conforming compiler is doomed to failure.

Master Develop
Drone Build Status Build Status
Github Actions Build Status Build Status

The Multiprecision Library provides integer, rational, floating-point, complex and interval number types in C++ that have more range and precision than C++'s ordinary built-in types. The big number types in Multiprecision can be used with a wide selection of basic mathematical operations, elementary transcendental functions as well as the functions in Boost.Math. The Multiprecision types can also interoperate with the built-in types in C++ using clearly defined conversion rules. This allows Boost.Multiprecision to be used for all kinds of mathematical calculations involving integer, rational and floating-point types requiring extended range and precision.

Multiprecision consists of a generic interface to the mathematics of large numbers as well as a selection of big number back ends, with support for integer, rational and floating-point types. Boost.Multiprecision provides a selection of back ends provided off-the-rack in including interfaces to GMP, MPFR, MPIR, TomMath as well as its own collection of Boost-licensed, header-only back ends for integers, rationals, floats and complex. In addition, user-defined back ends can be created and used with the interface of Multiprecision, provided the class implementation adheres to the necessary concepts.

Depending upon the number type, precision may be arbitrarily large (limited only by available memory), fixed at compile time (for example 50 or 100 decimal digits), or a variable controlled at run-time by member functions. The types are expression-template-enabled for better performance than naive user-defined types.

The full documentation is available on boost.org.

Support, bugs and feature requests

Bugs and feature requests can be reported through the Gitub issue tracker (see open issues and closed issues).

You can submit your changes through a pull request.

There is no mailing-list specific to Boost Multiprecision, although you can use the general-purpose Boost mailing-list using the tag [multiprecision].

Development

Clone the whole boost project, which includes the individual Boost projects as submodules (see boost+git doc):

git clone https://github.com/boostorg/boost
cd boost
git submodule update --init

The Boost Multiprecision Library is located in libs/multiprecision/.

Running tests

First, make sure you are in libs/multiprecision/test. You can either run all the tests listed in Jamfile.v2 or run a single test:

../../../b2                        <- run all tests
../../../b2 test_complex           <- single test

All Time

Christopher Kormanyos
Contributor
Madhur Chauhan
Madhur Chauhan
Contributor
Paul A. Bristow
Paul A. Bristow
Contributor
NAThompson
NAThompson
Contributor
Iskandarov Lev Andreevich
Contributor
Nick
Nick
Contributor
Edward Diener
Edward Diener
Contributor
Marshall Clow
Marshall Clow
Contributor
Andrey Semashev
Andrey Semashev
Contributor
Beman Dawes
Beman Dawes
Contributor
Raffi Enficiaud
Raffi Enficiaud
Contributor
Glen Fernandes
Glen Fernandes
Contributor
Rene Rivera
Rene Rivera
Contributor
Tinko Bartels
Tinko Bartels
Contributor
Peter Dimov
Peter Dimov
Contributor
Jürgen Hunold
Jürgen Hunold
Contributor
sdarwin
sdarwin
Contributor
Pavel I. Kryukov
Pavel I. Kryukov
Contributor
AntonBikineev
AntonBikineev
Contributor
Cosmin Boaca
Contributor
Alexandre Hamez
Alexandre Hamez
Contributor
emfrias
emfrias
Contributor
Paolo Galeone
Paolo Galeone
Contributor
anilmuthigi
anilmuthigi
Contributor
Sergey Zubkov
Sergey Zubkov
Contributor
Paul A. Bristow
Paul A. Bristow
Contributor
acc987
acc987
Contributor
Sergei Fedorov
Sergei Fedorov
Contributor
Jay Freeman (saurik)
Jay Freeman (saurik)
Contributor
Mikhail Komarov
Mikhail Komarov
Contributor
Mikhail Komarov
Mikhail Komarov
Contributor
Hans Dembinski
Hans Dembinski
Contributor
E Kawashima
E Kawashima
Contributor
Giovanni Mascellani
Giovanni Mascellani
Contributor
zerotypos-found
zerotypos-found
Contributor
Brian Wignall
Brian Wignall
Contributor
Daniel James
Daniel James
Contributor
Marcel Raad
Marcel Raad
Contributor